// 策略管理
import request from '@/utils/request.js'
/**
 * 删除策略
 * @param {object} params
 * @returns Promise
 */
export const delPolicyAPI = params => request({
  url: `/vm-service/policy/${params.policyId}`,
  method: 'DELETE',
  params
})
/**
 * 新增策略
 * @param {string} policyName 策略名称
 * @param {integer} discount 折扣比例数
 * @returns Promise
 */
export const postPolicyAPI = data => request({
  url: '/vm-service/policy',
  method: 'POST',
  data
})
/**
 * 根据策略搜索售货机
 * @param {object} params
 * @returns Promise
 */
export const getPolicyIdAPI = params => request({
  url: `/vm-service/policy/vmList/${params.policyId}`,
  params
})
/**
 * 策略搜索
 * @param {object} params
 * @returns Promise
 */
export const getPolicySearchAPI = params => request({
  url: '/vm-service/policy/search',
  params
})
/**
 * 修改策略
 * @param {object} data
 * @returns Promise
 */
export const putPolicyEditAPI = data => request({
  url: `/vm-service/policy/${data.policyId}`,
  method: 'PUT',
  data
})
